﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Web;
using System.Web.UI;
using System.Web.UI.WebControls;
using Talento21.Negocio.Servicio;

namespace Talento21.Pages.Login
{
    public partial class Login : System.Web.UI.Page
    {
        protected void Page_Load(object sender, EventArgs e)
        {

            var div = (System.Web.UI.HtmlControls.HtmlGenericControl)LoginPanel.FindControl("DivError");
            div.Visible = false;

        }

        protected void LoginPanel_LoginError(object sender, EventArgs e)
        {

            var div = (System.Web.UI.HtmlControls.HtmlGenericControl)LoginPanel.FindControl("DivError");
            div.Visible = true;

        }

        protected void LoginPanel_LoggedIn(object sender, EventArgs e)
        {
            string loggedUser = LoginPanel.UserName;

            var srvUsuario = new SrvUsuario();
            var usuario = srvUsuario.ObtenerUsuario(loggedUser);


            Session["usuario"] = usuario;
            Session["Emp_Rut"] = usuario.Emp_Rut;


        }


    }
}